<template>
    <div>
        <a-modal
            :title="modalTitle"
            :visible="visible"
            :maskClosable="false"
            :closable="true"
            :destroyOnClose="true"
            width="100%"
            :dialog-style="{ margin: '0 auto' }"
            wrapClassName="budgetDeclaration-modal-fullmodal"
            @cancel="closeVisible">
            <div>
                <div class="container" :style="{ display: 'block' }">
                    <div class="left-panel budgetDeclaration-modal-div-box" :style="{ flex: '1 1 100%' }">
                        <div class="tabs-card-edit-box">
                            <a-tabs type="card" v-model:activeKey="summaryActiveKey" @change="summaryActiveChange">
                                <a-tab-pane key="财务审核(一上)" tab="一上"></a-tab-pane>
                                <a-tab-pane key="财务审核(二上)" tab="二上" v-if="rawData.flx == '财务审核(二上)'"></a-tab-pane>
                                <a-tab-pane key="流转记录" tab="流转记录"></a-tab-pane>
                            </a-tabs>
                        </div>
                        <div  class="tab-box-v1">
                            <div v-if="summaryActiveKey == '财务审核(一上)' || summaryActiveKey == '财务审核(二上)'" style="width: 100%;margin: 0 auto;padding-top: 30px;padding-bottom: 30px;">
                                <a-spin :spinning="spinning">
                                    <toExamineModule
                                        ref="toExamineModuleRef" />
                                </a-spin>
                            </div>
                            <div v-if="summaryActiveKey == '流转记录'" style="padding-top: 30px;">
                                <transferRecords
                                    ref="transferRecordsRef"
                                    :config="circulationDataTableConfig"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <template #footer>
                <a-button class="blue-btn" style="margin-right: 10px;" @click="printClick">
                    打印预览
                </a-button>
                <a-button class="blue-btn" style="margin-right: 10px;" @click="printProcedureClick()">
                    流程打印
                </a-button>
                <a-button class="blue-btn" style="margin-right: 10px;" @click="exportAll">
                    全部导出
                </a-button>
                <a-button style="margin-right: 10px;" @click="closeVisible">
                    关闭
                </a-button>
                <span v-if="linkName == '财务审核(一上)'">
                    <a-button v-if="isOpintion" class="blue-btn" @click="handleOk">
                        发起流程
                    </a-button>
                </span>
                <span v-else-if="linkName == '财务审核(二上)'">
                    <a-button v-if="isOpintion" class="blue-btn" @click="submitClick">提交并关闭</a-button>
                </span>
                <span v-else>
                    <a-button
                        v-if="isOpintion"
                        class="blue-btn"
                        @click="auditingVisible = true">
                        填写意见
                    </a-button>
                </span>

            </template>
        </a-modal>
        <a-modal
            v-model:visible="auditingVisible"
            title="审核意见填写"
            width="60%"
            wrapClassName="internalControl-reimbursement-auditingModal-form-box">
            <a-spin :spinning="tloading">
                <div style="width: 95%;margin: 0 auto;">
                    <a-form :form="cform" ref="form" class="internalControl-reimbursement-model-form-box">
                        <a-descriptions bordered style="width: 100%;" v-if="auditingVisible">
                            <a-descriptions-item :span="3" v-if="descriptionsData('办公室领导审核(一上)').hjmc && descriptionsData('办公室领导审核(一上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    办公室领导审核(一上)
                                </span>
                                <a-form-item ref="fysbgsldshyj" prop="fysbgsldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('办公室领导审核(一上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'fysbgsldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.fysbgsldshyj,'fysbgsldshyj')"
                                            v-decorator="[
                                                'fysbgsldshyj', {initialValue:formState.fysbgsldshyj,rules: rules.fysbgsldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.fysbgsldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('办公室领导审核(一上)').url" :src="descriptionsData('办公室领导审核(一上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.fysbgsldshr }}</span>
                                            <span>{{ formState.fysbgsldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                            <a-descriptions-item :span="3" v-if="descriptionsData('领导班子审核(一上)').hjmc && descriptionsData('领导班子审核(一上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    领导班子审核(一上)
                                </span>
                                <a-form-item ref="fyszxldshyj" prop="fyszxldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('领导班子审核(一上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'fyszxldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.fyszxldshyj,'fyszxldshyj')"
                                            v-decorator="[
                                                'fyszxldshyj', {initialValue:formState.fyszxldshyj,rules: rules.fyszxldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.fyszxldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('领导班子审核(一上)').url" :src="descriptionsData('领导班子审核(一上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.fyszxldshr }}</span>
                                            <span>{{ formState.fyszxldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                            <a-descriptions-item :span="3" v-if="descriptionsData('办公室领导审核(二上)').hjmc && descriptionsData('办公室领导审核(二上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    办公室领导审核(二上)
                                </span>
                                <a-form-item ref="fesbgsldshyj" prop="fesbgsldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('办公室领导审核(二上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'fesbgsldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.fesbgsldshyj,'fesbgsldshyj')"
                                            v-decorator="[
                                                'fesbgsldshyj', {initialValue:formState.fesbgsldshyj,rules: rules.fesbgsldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.fesbgsldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('办公室领导审核(二上)').url" :src="descriptionsData('办公室领导审核(二上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.fesbgsldshr }}</span>
                                            <span>{{ formState.fesbgsldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                            <a-descriptions-item :span="3" v-if="descriptionsData('领导班子审核(二上)').hjmc && descriptionsData('领导班子审核(二上)').blzt !== '已办'">
                                <span slot="label" class="descriptions-label-slot">
                                    <span class="xhText">*</span>
                                    领导班子审核(二上)
                                </span>
                                <a-form-item ref="feszxldshyj" prop="feszxldshyj" class="zm-form-model">
                                    <div style="width: 100%;" v-if="descriptionsData('领导班子审核(二上)').blzt !== '已办'">
                                        <reviewOpinions
                                            :ref="'reviewOpinionsRef'+'feszxldshyj'"
                                            @getInputOpinion="getInputOpinion"
                                            @openOpinions="opinions('ideaType',formState.feszxldshyj,'feszxldshyj')"
                                            v-decorator="[
                                                'feszxldshyj', {initialValue:formState.feszxldshyj,rules: rules.feszxldshyj}]"
                                        />
                                    </div>
                                    <div style="width: 100%;" v-else>
                                        <p>{{ formState.feszxldshyj }}</p>
                                        <div class="yjqm-right-bottom">
                                            <img v-if="descriptionsData('领导班子审核(二上)').url" :src="descriptionsData('领导班子审核(二上)').url" alt="" class="yjqmImg"/>
                                            <span v-else class="yjqmImg">{{ formState.feszxldshyjsj }}</span>
                                            <span>{{ formState.feszxldshyjsj }}</span>
                                        </div>
                                    </div>
                                </a-form-item>
                            </a-descriptions-item>
                        </a-descriptions>
                    </a-form>
                </div>
            </a-spin>
            <template slot="footer">
                <a-button @click="saveClick()">保存</a-button>
                <a-button class="blue-btn" type="primary" @click="submitClick()">提交并关闭</a-button>
                <a-button class="red-btn" type="primary" @click="returnClick()">退回</a-button>
            </template>
        </a-modal>
        <printModal ref="printModalRef" />
    </div>
</template>

<script>
import {
    yssbHzbd,
    yssbEditYs,
    yssbFirstJs,
    yssbHyjlList,
    yssbDehyjl,
    yssbInitBzFlow,
    pidgetlchj,
    getMoreUserSignLinkList,
    yssbSaveFlow,
    yssbSubmitFlow,
    yssbSfcw,
    yssbGetYssbPrintData,
    downMyQm,
} from './service/index'
import transferRecords from '@/views/administrativeOffice-new/modal/transferRecords'
import assessCheckApi from './service/api.js'
import toExamineModule from '../finance/toExamine'
import printModal from './print'
export default {
    components: {
        transferRecords,
        toExamineModule,
        printModal
    },
    data() {
        return {
            modalTitle: '',
            visible: false,
            spinning: false,
            financeList: [],
            amountData: [],
            summaryActiveKey: '财务审核(一上)',
            rawData: {},
            operationLogList: [],
            circulationDataTableConfig: {
                api: assessCheckApi.yssbFlowJkPage,
                rowId: 'id',
                urlType: true,
                paramet:{
                    oaid: ''
                }
            },
            isView: false,
            formState: {},
            linkName: '',
            linkList: [
                {
                    name: '财务审核(一上)',
                    flx: '财务审核(一上)'
                },{
                    name: '办公室领导审核(一上)',
                    flx: '财务审核(一上)'
                },{
                    name: '领导班子审核(一上)',
                    flx: '财务审核(一上)'
                },{
                    name: '财务审核(二上)',
                    flx: '财务审核(二上)'
                },{
                    name: '办公室领导审核(二上)',
                    flx: '财务审核(二上)'
                },{
                    name: '领导班子审核(二上)',
                    flx: '财务审核(二上)'
                },
            ],
            displayList: [],
            cform:this.$form.createForm(this, { name: 'cform' }),
            auditingVisible: false,
            tloading: false,
            rules:{
                fysbgsldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
                fyszxldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
                fesbgsldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
                feszxldshyj: [
                    {
                        required: true,
                        message: '请填写审批意见',
                        trigger: 'blur',
                    }
                ],
            },
            isOpintion: true,
            isCw: false,
        };
    },
    methods: {
        // 是否财务
        getYssbSfcw(){
            yssbSfcw().then(res => {
                if(res.success && res.result){
                    this.isCw = res.result
                }
            })
        },
        getData(val1,val2){
            this.visible = true
            //console.log(val1,val2)

            this.linkName = val1.hjmc
            this.isView = this.linkName=='财务审核(二上)'?false:true
            this.modalTitle = this.linkName=='我的已办'?'预算申报计划-查看':this.linkName
            this.isOpintion = this.linkName=='我的已办'?false:true
            this.formState = val1.oaMap
            this.formState.jobid = val1.jobMap?val1.jobMap.id:''

            this.getDisplayList(this.formState.id)
            this.circulationDataTableConfig.paramet.oaid = this.formState.id
            this.$nextTick(() => {
                //console.log('====================S',this.$refs.toExamineModuleRef)
                this.$refs.toExamineModuleRef.getData(val1,null,'modal')
            })
        },
        getyssbGetYs(val,val1){
            yssbHzbd({...val}).then(res => {
                if(res.success){
                    this.financeList = res.result
                    if(val1){
                        this.editYssbhj({id:''})
                    }
                }
            })
        },
        getDisplayList(ids){
            pidgetlchj({pid: ids}).then((res) => {
                let arr1 = res.result
                this.displayList = []
                this.displayList = res.result

                let arrItem = arr1.filter(item => item.hjmc == '财务审核(二上)')
                //console.log('MMMMMMMMMM',arrItem)
                this.rawData = {
                    jhid: this.formState.id,
                    flx: arrItem.length?arrItem[0].hjmc:'财务审核(一上)'
                }
                //console.log('KKKKKKKKKKKK',this.rawData)
                this.getyssbGetYs(this.rawData,'1')
                if(arrItem.length && arrItem[0].hjmc == '财务审核(二上)'){
                    this.summaryActiveKey = '财务审核(二上)'
                }

                this.displayList.forEach(async (item,index) => {
                    if(item.blrid && item.blzt!=='待办'){
                        let resa = await getMoreUserSignLinkList({ids:item.blrid})
                        if(resa.success && resa.result.length){
                            if(resa.result[0].signLink == ''){
                                this.displayList[index] = {
                                    ...item,
                                    url: null
                                }
                            } else {
                                this.displayList[index] = {
                                    ...item,
                                    url: resa.result[0].signLink+'&aa='+Date.now()
                                }
                            }
                        } else {
                            this.displayList[index] = {
                                ...item,
                                url: null
                            }
                        }
                    } else {}
                })
                //console.log('最终获得的签名图片列表---',this.displayList)
            })
        },
        descriptionsData(hjmc){
            let data = {}
            this.displayList.forEach(item => {
                // //console.log('descriptionsData000',hjmc,item)
                if(item.hjmc == hjmc){
                    data = {...item}
                }
            })
            // //console.log('descriptionsData',data)
            return data
        },
        opinions(val1,val2,val3){
            //console.log(val1,val2,val3)
            this.$refs[`reviewOpinionsRef${val3}`].getData({opinionType:val1,oldVal:val2,valueData:{hjmc:val3}})
        },
        getInputOpinion(val,valueData){
            //console.log('--------',val,valueData)
            let data = this.formState
            data[valueData.hjmc] = val
            this.cform.setFieldsValue({
                fysbgsldshyj: this.formState.fysbgsldshyj,
                fyszxldshyj: this.formState.fyszxldshyj,
                fesbgsldshyj: this.formState.fesbgsldshyj,
                feszxldshyj: this.formState.feszxldshyj,
            });
        },
        closeVisible() {
            this.visible = false
            // if(this.isView == true){
            //     this.visible = false
            // } else {
            //     let that = this
            //     this.$confirm({
            //         title:'当前页面关闭前，是否保存当前操作记录？',
            //         okText: '确认保存',
            //         cancelText: '取消保存',
            //         onOk() {
            //             yssbDehyjl({jhid: that.rawData.jhid,sfbc: '是'}).then(res => {
            //                 if(res.success){
            //                     that.$message.success('已保存当前操作记录')
            //                     that.visible = false
            //                 }
            //             })
            //         },
            //         onCancel() {
            //             yssbDehyjl({jhid: that.rawData.jhid,sfbc: '否'}).then(res => {
            //                 if(res.success){
            //                     that.$message.success('已取消保存当前操作记录')
            //                     that.visible = false
            //                 }
            //             })
            //         },
            //     })
            // }
        },
        // 返回药品注册的分类下的总条数
        totalListLength(Item){
            //console.log('************',Item.reduce((total, item) => total + item.list.length, 0))
            return Item.reduce((total, item) => total + item.list.length, 0);
        },
        // 进入首次获取合计
        getyssbFirstJs(){
            yssbFirstJs({jhid: this.rawData.jhid}).then(res => {
                if(res.success){
                    this.amountData = res.result
                }
            })
        },
        // 操作记录
        getyssbHyjlList(val){
            yssbHyjlList({...val}).then(res => {
                if(res.success){
                    this.operationLogList = res.result
                }
            })
        },
        // 编辑
        editYssbhj(val,val1){
            // let arrItem = this.linkList.filter(item => item.name == this.linkName)
            yssbEditYs({...val,fyssbjhid: this.rawData.jhid,flx: this.rawData.flx}).then(res => {
                if(res.success){
                    this.amountData = res.result
                    if(val1){
                        this.getyssbGetYs(this.rawData)
                        this.getyssbHyjlList(this.rawData)
                    }
                    this.$message.success(res.message)
                } else {
                    this.$message.warning(res.message)
                }
            })
        },
        // 返回合计
        getAmountData(Item,type,childType){
            // //console.log('itemArr000',Item,type,childType,this.amountData)
            if(this.amountData.length){
                const itemArr = this.amountData.filter(item => item.name == Item)
                // //console.log('itemArr1',itemArr)
                if(childType){
                    var itemArr1 = itemArr[0].list.filter(item => item.name == childType)
                    return itemArr1[0][type]
                }
                // //console.log('itemArr4',itemArr,itemArr1)
                return itemArr[0][type]
            }
        },
        summaryActiveChange(key) {
            this.summaryActiveKey = key
            if( key == '财务审核(二上)' || key == '财务审核(一上)'){
                this.isView = false
                let data = {
                    jhid: this.rawData.jhid,
                    flx: key
                }
                this.$nextTick(() => {
                    this.$refs.toExamineModuleRef.getWriteData(data,'modal',this.linkName=='我的已办'?'1':null)
                })
            }
        },
        saveClick(){
            this.bloading = true
            let data = {
                jobid: this.formState.jobid,
                map: {},
                oaid: this.formState.id,
                opinion: "",
            }
            if(this.linkName == '办公室领导审核(一上)'){
                data.opinion = this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                data.map = {
                    fysbgsldshyj: this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                }
            } else if(this.linkName == '领导班子审核(一上)'){
                data.opinion = this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                data.map = {
                    fyszxldshyj: this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                }
            } else if (this.linkName == '办公室领导审核(二上)'){
                data.opinion = this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:''
                data.map = {
                    fesbgsldshyj: this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:'',
                }
            } else if (this.linkName == '领导班子审核(二上)'){
                data.opinion = this.formState.feszxldshyj?this.formState.feszxldshyj:''
                data.map = {
                    feszxldshyj: this.formState.feszxldshyj?this.formState.feszxldshyj:''
                }
            }
            yssbSaveFlow(data).then(res => {
                if(res.success){
                    this.$message.success(res.message)
                } else {
                    this.$message.warning(res.message)
                }
                this.bloading = false
            })
        },
        handleOk(){
            let that = this
            that.$confirm({
                title:'您确认全部数据已修改完毕，要发起审核流程吗？',
                onOk() {
                    let data = {
                        id: that.rawData.jhid,
                        fsffqlc: '是',
                    }
                    yssbInitBzFlow(data).then(res => {
                        if(res.success){
                            that.$message.success('已发起审核流程')
                            that.isView = true
                            that.isRightPanelVisible = false
                            that.getWriteData(that.rawData)
                        }
                    })
                }
            })
        },
        submitClick(){
            //console.log(this.formState)
            this.cform.validateFields((err, values) => {
                if (!err) {
                    let data = {
                        jobid: this.formState.jobid,
                        map: {},
                        oaid: this.formState.id,
                        opinion: "",
                    }
                    if(this.linkName == '办公室领导审核(一上)'){
                        data.opinion = this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                        data.map = {
                            fysbgsldshyj: this.formState.fysbgsldshyj?this.formState.fysbgsldshyj:''
                        }
                    } else if(this.linkName == '领导班子审核(一上)'){
                        data.opinion = this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                        data.map = {
                            fyszxldshyj: this.formState.fyszxldshyj?this.formState.fyszxldshyj:''
                        }
                    } else if(this.linkName == '财务审核(二上)'){
                        data.opinion = '同意'
                        data.map = {
                            fescwshyj: '同意'
                        }
                    } else if (this.linkName == '办公室领导审核(二上)'){
                        data.opinion = this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:''
                        data.map = {
                            fesbgsldshyj: this.formState.fesbgsldshyj?this.formState.fesbgsldshyj:'',
                        }
                    } else if (this.linkName == '领导班子审核(二上)'){
                        data.opinion = this.formState.feszxldshyj?this.formState.feszxldshyj:''
                        data.map = {
                            feszxldshyj: this.formState.feszxldshyj?this.formState.feszxldshyj:''
                        }
                    }
                    var that = this
                    that.$confirm({
                        title: '您确定要提交吗?',
                        onOk() {
                            that.tloading = true
                            yssbSubmitFlow(data).then(res => {
                                if(res.success){
                                    that.$message.success(res.message)
                                    that.$emit('success')
                                    that.auditingVisible = false
                                    that.visible = false
                                } else {
                                    that.$message.warning(res.message)
                                }
                                that.tloading = false
                            })
                        },
                        onCancel() {},
                    })
                }
            })
        },
        returnClick(){
            this.cform.validateFields((err, values) => {
                if (!err) {
                    var that = this
                    that.$confirm({
                        title: '您确定要退回吗?',
                        onOk() {
                            // that.spinning = true
                            //console.log('历史列表',that.jobHistoryList)
                            let slist = {}
                            if(that.linkName == '财务审核'){
                                slist = that.jobHistoryList.filter(item => item.fhjmc == '填写报销单')
                            }
                            if(that.linkName == '出纳审核'){
                                slist = that.jobHistoryList.filter(item => item.fhjmc == '财务审核')
                            }
                            //console.log(slist)
                            let ids = slist[0].id
                            // that.returnFuntion(that.formState.jobid,sortedDates[slist.length - 1].id)
                            // let slist = list.filter(item => item.fhjmc == '起草')
                            // const sortedDates = slist.sort((a, b) => new Date(b) - new Date(a));
                            that.returnFuntion(that.formState.jobid,ids)
                        },
                        onCancel() {},
                    });
                }
            })
        },
        returnFuntion(jobid,ids){
            let returnStr = ''
            if(this.linkName == '财务审核'){
                returnStr = this.formState.fesbgsldshyj
            } else if(this.linkName == '出纳审核'){
                returnStr = '不同意'
            }
            let data = {
                jobid: jobid,
                opinion: returnStr,
                shjid: ids,
            }
            this.tloading = true
            returnUpperzdyFlowJob(data).then(res => {
                if(res.code == 200){
                    this.$emit('success')
                    this.$message.success(res.message)
                    this.auditingVisible = false
                    this.visible = false
                } else {
                    this.$message.error(res.message)
                }
                this.tloading = false
            })
        },
        printClick(){
            //console.log('打印',this.$refs.toExamineModuleRef.financeList)
            let yuSuanData = {
                jcList: this.$refs.toExamineModuleRef.financeList,
                ktList: this.$refs.toExamineModuleRef.ktList,
                ysList: this.$refs.toExamineModuleRef.ysList,
                pxList: this.$refs.toExamineModuleRef.pxList,
            }
            // this.$refs.printModalRef.getData(true,{val1:yuSuanData,val2:this.$refs.toExamineModuleRef.jxList})
            this.printProcedureClick(yuSuanData)
        },
        printProcedureClick(yuSuanData){
            var data = {
                jhid: this.rawData.jhid,
                flx: this.rawData.flx,
            }
            yssbGetYssbPrintData(data).then(async(res) => {
                if(res.success){
                    let Items = res.result.fjob
                    for (let index = 0; index < Items.length; index++) {
                        let resa = await getMoreUserSignLinkList({ids: Items[index].fdbrid})
                        if(resa.result.length && resa.result[0].signLink !== ''){
                            //console.log('得了---',Items[index])
                            Items[index] = {...Items[index],fqm: resa.result[0].signLink+'&aa='+Date.now()}
                        } else {
                            //console.log('没得啊---',Items[index])
                            Items[index] = {...Items[index],fqm: null}
                        }
                        if(index == Items.length - 1){
                            let formData = {
                                ...res.result,
                                fjob: [...Items]
                            }
                            if(yuSuanData){
                                this.$refs.printModalRef.getData(true,{val1:yuSuanData,val2:this.$refs.toExamineModuleRef.jxList,val3: formData})
                            } else {
                                this.$refs.printModalRef.getData(true,{val3: formData},true)
                            }
                        }
                    }
                }
            })
        },
        exportAll(){
            let that = this
            that.$confirm({
                title:'您确认要导出全部数据吗？',
                onOk() {
                    let typeList = ['审评','课题','印刷','培训']
                    typeList.forEach((item) => {
                        that.$refs.toExamineModuleRef.exportClickTable(item)
                    })
                    that.$refs.toExamineModuleRef.exportJx()
                }
            })
        }
    },
};
</script>

<style lang="less">
.budgetDeclaration-modal-fullmodal {
    .ant-modal {
        background-color: #5ca3e5;
        position: static;
        width: 100%;
        height: 100%;
        top: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 auto !important;
    }
    .ant-modal-content {
        height: 100%;
    }
    .ant-modal-body {
        padding: 15px !important;
        background-color: white;
        overflow-y: auto;
        height: calc(100vh - 108px) !important;
    }
    .ant-modal-wrap {
        background-color: white;
    }
    .ant-list-empty-text {
        padding: 0px !important;
    }
    .ant-empty-normal {
        margin: 0px !important;
    }
    .budgetDeclaration-modal-div-box {
        .tabs-card-edit-box{
            margin: 5px 15px 0 15px;
            .ant-tabs-bar{
                // border: 0 !important;
                border-color: #38f !important;
                margin: 0 !important;
            }
            .ant-tabs-tab{
                background: #edeff3 !important;
                font-size: 14px !important;
                margin-left: 1px !important;
                height: 30px !important;
                line-height: 30px !important;

            }
            .ant-tabs-tab-active{
                margin: 0 !important;
                margin-left: 0 !important;
                margin-right: 1px !important;
                background-color: #38f !important;
                color: #fff !important;
                height: 32px !important;
                border: 1px solid #38f !important;
                border-bottom: 0 !important;
                padding:0 15px !important;

            }
            .ant-tabs-nav-container{
                height: 32px !important;
            }
        }
        .tab-box-v1{
            border: 1px solid #38f;
            border-top: 0;
            margin: 0 15px;
            // height: calc((100vh - 260px) / 2 );
            height: calc(100vh - 230px);
            overflow: auto;
            overflow-y: auto;
            .form-title {
                text-align: center;
            }
            .table-Lu{
                width: 794px;
                margin: 0 auto;
                // margin-top: 4mm;
                font-size: 16px;
                table-layout: fixed;
                th {
                    font-family: 'SimSun', serif;
                    text-align: center;
                    font-size: 18px;
                    font-weight: bold !important;
                    line-height: 2.5;
                    padding: 0px;
                    color: black;
                }
                td {
                    font-family: 'SimSun', serif;
                    min-width: 150px;
                    text-align: center;
                    line-height: 1.5;
                    padding: 0px;
                    font-size: 18px;
                    min-height: 46px !important;
                    height: 46px;
                    color: black;
                    word-wrap:break-word;
                    word-break:break-all;
                    white-space:normal;
                    .ant-form-item {
                        margin-bottom: 0px;
                    }
                }
                .ant-input-number {
                    width: 90% !important;
                    border: 1px solid dodgerblue !important;
                }
            }
            .text-style {
                font-family: 'SimSun', serif;
                font-size: 18px;
                color: black;
            }
            .ant-collapse-header{
                width: 100% !important;
            }
        }
        .internalControl-reimbursement-model-form-box {
            padding: 0 15px;
            margin-top: 20px;
            .ant-descriptions-bordered .ant-descriptions-item-label{
                font-weight: 600;
                color: rgba(0, 0, 0, 0.85);
                background-color:#e6f7ff;
                width: 150px !important;
                text-align: center;
                font-size: 16px;
                font-family:simHei !important;
            }
            .ant-descriptions-bordered .ant-descriptions-item-label, .ant-descriptions-bordered .ant-descriptions-item-content{
                padding: 5px 10px !important;
                .ant-form-item {
                    margin-bottom: 0 !important;
                }

            }
            .descriptions-row .descriptions-label-slot{
                display: flex;
                align-items: center;
                width: 120px !important;//确保左侧固定文字不会换行
                justify-content: center;
                text-align: center;
            }
            .xhText{
                color: #f5222d;
                line-height: 31px;
                font-size: 14px;
                font-weight: 600;
                height: 30px;
            }
            .descriptions-item-center{

            }
            .ant-form-inline .ant-form-item-with-help{
                margin-bottom: 0px !important;
            }
            .zm-form-model{
                display: flex;
                .ant-form-item-control-wrapper{
                    flex: 1;
                }
            }
            .ant-descriptions-bordered .ant-descriptions-row{
                border-bottom: 1px solid #e4e3e3;
            }
            .ant-descriptions-bordered .ant-descriptions-item-label, .ant-descriptions-bordered .ant-descriptions-item-content{
                border-right: 1px solid #e4e3e3;
                min-width: 100px;
            }
            .ant-descriptions-bordered .ant-descriptions-view{
                border: 1px solid #e4e3e3;
                border-right: 0;
            }
            .ant-descriptions-row:last-child{
                border-bottom: 0;
            }

        }
        .yjqm-right-bottom {
            text-align: right;
            margin-right: 20px;
            margin-bottom: 10px;
            line-height: 30px;
        }
        .yjqmImg {
            width: 100px;
            height: 30px;
            padding-right: 20px;
        }
        .compSelectorHydd {
            div:first-child {
            width: 200px;
            }
        }
        .comp-select-box-hys-ksdw {
            .ant-checkbox-group-item {
                width: 180px !important;
                margin: 0px !important;
                padding-bottom: 5px;
                text-align: left;
                font-weight: 100;
            }
        }
    }
    .container {
        transition: flex 0.3s ease; /* 添加过渡效果使布局变化更平滑 */
        background-color: unset;
        .left-panel {
            // background-color: #f0f0f0; /* 可选：添加背景色以区分左右面板 */
            height: 100%; /* 示例高度，你可以根据需要调整 */
            /* 使用flex属性来控制左边面板的伸缩性 */
            flex-grow: 1; /* 当右边面板显示时，左边面板占据剩余空间 */
            flex-shrink: 1; /* 当右边面板隐藏时，左边面板可以缩小 */
            flex-basis: 100%; /* 初始基础大小设置为100% */
        }
        .right-panel {
            padding: 5px 10px;
            width: 303px; /* 右边面板的宽度 */
            // background-color: #ddd; /* 可选：添加背景色以区分左右面板 */
            background-color: #f0f2f5;
            height: 100%; /* 示例高度，与左边面板保持一致 */
            display: block;
            align-items: center;
            justify-content: center;
            .right-panel-title {
                background-color: rgb(102, 194, 79);
                text-align: center;
                font-family: '宋体' !important;
                font-weight: bold;
                margin-top: 0.5em;
                color: white;
                border: 1px solid #e4e3e3;
                border-radius: 50px;
                padding: 5px;
            }
            .ant-list-split .ant-list-item {
                border-bottom: 1px solid #b2afaf;
            }
        }
        .right-panel button {
            /* 按钮样式 */
        }
    }
}
</style>
